package com.multi.thread.chapter03.demo13;

import java.io.IOException;
import java.io.PipedReader;

public class ReadData {
	
	public void readMethod(PipedReader input) {
		try {
			System.out.println("read : ");
			char[] array = new char[20];
			int readLength = input.read(array);
			while (readLength != -1) {
				String newData = new String(array, 0, readLength);
				System.out.println(newData);
				readLength = input.read(array);
			}
			System.out.println();
			input.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
